It depends on the order of operations for the construction of the structure.
Let's start assuming the structure is as simple as the image you've given us: a single story with a slab supported by columns.
If the columns and slab are built, their formwork is removed and only then the wall is built, the wall shouldn't suffer any stresses. This is because the removal of the slab's formwork allowed it to deform itself into a stable configuration. When your wall comes up to the slab, it will simply close the gap, but won't have to support the slab since, well, the slab is already supporting itself. This will only be true in the short term, however. Over time, creep will try to further deflect the slab, and the wall will end up resisting that movement, generating a compressive force. This can be reduced by increasing the time between removal of the formwork and the raising of the wall, thereby increasing the amount of creep which occurs without harming the wall (this effect would be minimal, though).
If the columns and slabs are built and the wall is raised before their formwork is removed, then the wall will suffer compression. In this case, when the formwork is removed, the wall will (try to) impede the deflection of the slab and will therefore be compressed.
If the slab is actually supported by a ring of beams, the same effects apply as described above. That being said, the beams will dramatically increase the stiffness of the slabs, and will therefore reduce the deflection of the structure above the wall. This will reduce the compression suffered by the wall (either immediately or due to creep), but not eliminate it.
If the structure actually has multiple floors, then the entire structure should be built before any walls are fully raised. The walls should also be raised starting from the top floor, and then proceeding downwards. This way, the load due to the wall of an upper floor will already have deformed the structure before a wall is raised. This way we can guarantee that a wall will not participate in supporting the walls above it. If the walls are made of brick, these can be raised along with the structure, so long as they leave a gap between their top course (row of bricks) and the bottom of the slab. Once the entire structure is raised, that gap can be filled (starting from the top floor).
As @AndyT well mentioned in a comment below, regardless of when the wall is raised, it will participate to some extent in resisting loads due to live/accidental loads.